home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.multimedia;
-
- import java.util.Vector;
- import sun.audio.AudioDataStream;
- import sun.audio.AudioPlayer;
-
- class SoundViewerThread extends Thread {
- private Vector clips;
- private boolean doEnd = false;
- private AudioDataStream curStream;
- private int repeatCt;
- private boolean sync = true;
-
- SoundViewerThread(Vector var1, boolean var2, int var3) {
- this.clips = var1;
- this.sync = var2;
- this.repeatCt = var3;
- }
-
- public void run() {
- while(this.repeatCt == -1 || this.repeatCt-- > 0) {
- int var1 = this.clips.size();
-
- for(int var2 = 0; var2 < var1 && !this.doEnd; ++var2) {
- SoundViewerItem var3 = (SoundViewerItem)this.clips.elementAt(var2);
- this.curStream = new AudioDataStream(var3.data);
- AudioPlayer.player.start(this.curStream);
- if (this.sync) {
- try {
- Thread.sleep((long)var3.delay);
- } catch (InterruptedException var4) {
- }
- }
- }
-
- this.curStream = null;
- }
-
- this.doEnd = false;
- }
-
- void doSync(boolean var1) {
- this.sync = var1;
- }
-
- void doStop() {
- if (this.curStream != null) {
- AudioPlayer.player.stop(this.curStream);
- }
-
- this.doEnd = true;
- }
- }
-